declare namespace exist = "http://exist.sourceforge.net/NS/exist"; 
declare namespace request="http://exist-db.org/xquery/request";
declare namespace xmldb="http://exist-db.org/xquery/xmldb";
declare namespace pm = "http://www.politicalmashup.nl";

import module namespace onderbrekings="http://www.example.com/onderbrekings" at "xmldb:exist:///db/projdb/modules/onderbrekingsdata.xqm";

let $collection := collection('/db/projdb/ge-2009')
let $file-name2 := 'perpartij.xml'
(: periodes to investigate :)
let $periods := ('2009-2010', '2010-2011', '2011-2012', '2012-2013', '2013-2014')

for $period in $periods
    let $file-name := concat('onderbrekersdata_', $period, '.xml')
    let $file-name1 := concat('onderbrekerstotalen_', $period, '.xml')
    let $file-name3 := concat('onderbrokendoor_', $period, '.xml')
    return onderbrekings:maakData($collection[data(./root//pm:legislative-period) = $period],$file-name,$file-name1,$file-name3,$file-name2)